/*
 * HttpConnection.java
 *
 * Created on 2007/10/14 +0900
 *
 * $Revision: 33 $
 * $Date: 2008-07-27 15:31:44 +0000 (Sun, 27 Jul 2008) $
 */

package org.gikolet.framework.io.http;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author Tetsutaro (latest modification by $Author: tetsutaro.ss $)
 * @version $Revision: 33 $ $Date: 2008-07-27 15:31:44 +0000 (Sun, 27 Jul 2008) $
 */
public interface HttpConnection {
    String GET = "GET";

    /**
     * HTTP Head method.
     */
    String HEAD = "HEAD";

    /**
     * HTTP Post method.
     */
    String POST = "POST";

    /**
     * HTTP Status-Code 200
     */
    int HTTP_OK = 200;

    /**
     * HTTP Status-Code 201
     */
    int HTTP_CREATED = 201;

    /**
     * HTTP Status-Code 202
     */
    int HTTP_ACCEPTED = 202;

    /**
     * HTTP Status-Code 203
     */
    int HTTP_NOT_AUTHORITATIVE = 203;

    /**
     * HTTP Status-Code 204
     */
    int HTTP_NO_CONTENT = 204;

    /**
     * HTTP Status-Code 205
     */
    int HTTP_RESET = 205;

    /**
     * HTTP Status-Code 206
     */
    int HTTP_PARTIAL = 206;

    /**
     * HTTP Status-Code 300
     */
    int HTTP_MULT_CHOICE = 300;

    /**
     * HTTP Status-Code 301
     */
    int HTTP_MOVED_PERM = 301;

    /**
     * HTTP Status-Code 302
     */
    int HTTP_MOVED_TEMP = 302;

    /**
     * HTTP Status-Code 303
     */
    int HTTP_SEE_OTHER = 303;

    /**
     * HTTP Status-Code 304
     */
    int HTTP_NOT_MODIFIED = 304;

    /**
     * HTTP Status-Code 305
     */
    int HTTP_USE_PROXY = 305;

    /**
     * HTTP Status-Code 307
     */
    int HTTP_TEMP_REDIRECT = 307;

    /**
     * HTTP Status-Code 400
     */
    int HTTP_BAD_REQUEST = 400;

    /**
     * HTTP Status-Code 401
     */
    int HTTP_UNAUTHORIZED = 401;

    /**
     * HTTP Status-Code 402
     */
    int HTTP_PAYMENT_REQUIRED = 402;

    /**
     * HTTP Status-Code 403
     */
    int HTTP_FORBIDDEN = 403;

    /**
     * HTTP Status-Code 404
     */
    int HTTP_NOT_FOUND = 404;

    /**
     * HTTP Status-Code 405
     */
    int HTTP_BAD_METHOD = 405;

    /**
     * HTTP Status-Code 406
     */
    int HTTP_NOT_ACCEPTABLE = 406;

    /**
     * HTTP Status-Code 407
     */
    int HTTP_PROXY_AUTH = 407;

    /**
     * HTTP Status-Code 408
     */
    int HTTP_CLIENT_TIMEOUT = 408;

    /**
     * HTTP Status-Code 409
     */
    int HTTP_CONFLICT = 409;

    /**
     * HTTP Status-Code 410
     */
    int HTTP_GONE = 410;

    /**
     * HTTP Status-Code 411
     */
    int HTTP_LENGTH_REQUIRED = 411;

    /**
     * HTTP Status-Code 412
     */
    int HTTP_PRECON_FAILED = 412;

    /**
     * HTTP Status-Code 413
     */
    int HTTP_ENTITY_TOO_LARGE = 413;

    /**
     * HTTP Status-Code 414
     */
    int HTTP_REQ_TOO_LONG = 414;

    /**
     * HTTP Status-Code 415
     */
    int HTTP_UNSUPPORTED_TYPE = 415;

    /**
     * HTTP Status-Code 416
     */
    int HTTP_UNSUPPORTED_RANGE = 416;

    /**
     * HTTP Status-Code 417
     */
    int HTTP_EXPECT_FAILED = 417;

    /**
     * HTTP Status-Code 500
     */
    int HTTP_INTERNAL_ERROR = 500;

    /**
     * HTTP Status-Code 501
     */
    int HTTP_NOT_IMPLEMENTED = 501;

    /**
     * HTTP Status-Code 502
     */
    int HTTP_BAD_GATEWAY = 502;

    /**
     * HTTP Status-Code 503
     */
    int HTTP_UNAVAILABLE = 503;

    /**
     * HTTP Status-Code 504
     */
    int HTTP_GATEWAY_TIMEOUT = 504;

    /**
     * HTTP Status-Code 505
     */
    int HTTP_VERSION = 505;

    String getURL();

    void setRequestMethod(String method) throws IOException;

    String getRequestMethod();

    void setRequestProperty(String key, String value) throws IOException;

    String getRequestProperty(String key);

    int getResponseCode() throws IOException;

    String getResponseMessage() throws IOException;

    String getHeaderField(String name) throws IOException;

    String getEncoding() throws IOException;

    long getLength() throws IOException;

    String getType() throws IOException;

    long getDate() throws IOException;

    long getExpiration() throws IOException;

    long getLastModified() throws IOException;

    InputStream openInputStream() throws IOException;

    OutputStream openOutputStream() throws IOException;

    void close() throws IOException;
}
